﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterALSafa.Master" AutoEventWireup="true" CodeBehind="TE_Topic_HomeWork.aspx.cs" Inherits="School.Pages.Teaching.TE_Topic_HomeWork" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <table dir="rtl" style="width: 100%; float: right">
        <tr>
            <td>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <table align="right" dir="rtl" style="width: 100%; float: right">
                            <tr>
                                <td colspan="2" class="admintitle" align="center">
                                    ادخال بيانات
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap" style="width: 57px">
                                    المجمع
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlCampus" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                                        DataTextField="Name" DataValueField="Id" OnTextChanged="ddlCampus_TextChanged"
                                        Width="150px">
                                        <asp:ListItem Value="0">اختيار</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="ddlCampus"
                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap" style="width: 57px">
                                    الشهاده
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlCertificate" runat="server" AppendDataBoundItems="True"
                                        AutoPostBack="True" DataTextField="Name" DataValueField="Id" OnSelectedIndexChanged="ddlCertificate_SelectedIndexChanged"
                                        Width="150px" TabIndex="1">
                                        <asp:ListItem Value="0">اختيار</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="ddlCertificate"
                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap" style="width: 57px">
                                    المرحله
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlStadge" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                                        DataTextField="Name" DataValueField="Id" OnSelectedIndexChanged="ddlStadge_SelectedIndexChanged"
                                        Width="150px" TabIndex="2">
                                        <asp:ListItem Value="0">اختيار</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="ddlStadge"
                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap" style="width: 57px">
                                    الصف
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlGrade" runat="server" AppendDataBoundItems="True" DataTextField="Name"
                                        DataValueField="Id" Width="150px" TabIndex="3" AutoPostBack="True" OnSelectedIndexChanged="ddlGrade_SelectedIndexChanged">
                                        <asp:ListItem Value="0">اختيار</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="ddlGrade"
                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap" style="width: 57px">
                                    المادة
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlsubject" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                                        DataTextField="Sub_name" DataValueField="Id" OnSelectedIndexChanged="ddlsubject_SelectedIndexChanged"
                                        Width="150px">
                                        <asp:ListItem Value="0">اختيار</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" ControlToValidate="ddlsubject"
                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap" style="width: 57px">
                                    الوحدة
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlCourse" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                                        DataTextField="Course_Name" DataValueField="Id" OnSelectedIndexChanged="ddlCourse_SelectedIndexChanged"
                                        Width="150px">
                                        <asp:ListItem Value="0">اختيار</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator13" runat="server" ControlToValidate="ddlCourse"
                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap" style="width: 57px">
                                    اسم الدرس
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlTopic" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                                        DataTextField="Name" DataValueField="Id" OnSelectedIndexChanged="ddlTopic_SelectedIndexChanged"
                                        Width="150px">
                                        <asp:ListItem Value="0">اختيار</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator14" runat="server" ControlToValidate="ddlTopic"
                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap" style="width: 57px">
                                    التصنيف
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlCat" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                                        DataTextField="TypeName" DataValueField="Id" OnSelectedIndexChanged="ddlCat_SelectedIndexChanged"
                                        Width="150px">
                                        <asp:ListItem Value="0">اختيار</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator15" runat="server" ControlToValidate="ddlCat"
                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lbltst" runat="server" Visible="False"></asp:Label>
            </td>
        </tr>
        <tr>
            <td align="center">
                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                    <ContentTemplate>
                        <table dir="rtl" style="width: 100%; float: right">
                            <tr>
                                <td>
                                    <asp:GridView ID="gvBank_Q" runat="server" AllowPaging="True" AlternatingRowStyle-CssClass="GridItemAltername"
                                        AutoGenerateColumns="False" CssClass="Grid" DataKeyNames="Id" FooterStyle-CssClass="GridHeaderFooter"
                                        HeaderStyle-CssClass="GridHeaderFooter" OnPageIndexChanging="gvBank_Q_PageIndexChanging"
                                        PagerStyle-CssClass="GridPager" ShowFooter="True" Width="80%">
                                        <AlternatingRowStyle CssClass="GridItemAltername" />
                                        <Columns>
                                            <asp:TemplateField>
                                                <HeaderTemplate>
                                                    م
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <%# Container.DataItemIndex + 1 %>
                                                </ItemTemplate>
                                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="اختيار">
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="Chchoice" runat="server" />
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="Grad_name" HeaderText="الصف" ReadOnly="True" SortExpression="Grad_name" />
                                            <asp:BoundField DataField="Sub_name" HeaderText="المادة" ReadOnly="True" SortExpression="Sub_name" />
                                            <asp:BoundField DataField="Question_Categ" HeaderText="تصنيف السؤال" ReadOnly="True"
                                                SortExpression="Question_Categ" />
                                            <asp:BoundField DataField="Question_Type" HeaderText="نوع السؤال" ReadOnly="True"
                                                SortExpression="Question_Type" />
                                            <asp:TemplateField HeaderText="السؤال" SortExpression="Question">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="txtQues" runat="server" Text='<%# Bind("Question") %>' TextMode="MultiLine"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator16" runat="server" ControlToValidate="txtQues"
                                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Question") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="درجة السؤال">
                                                <FooterTemplate>
                                                    <asp:Button ID="btnAdd" runat="server" CssClass="graybutton" OnClick="btnAdd_Click"
                                                        Text="اضاافة" ValidationGroup="st" />
                                                </FooterTemplate>
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txtvalue" runat="server">0</asp:TextBox>
                                                    <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="txtvalue"
                                                        Display="Dynamic" ErrorMessage="ادخل قيمة" ForeColor="Red" Operator="DataTypeCheck"
                                                        Type="Double"></asp:CompareValidator>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                        <FooterStyle CssClass="GridHeaderFooter" />
                                        <HeaderStyle CssClass="GridHeaderFooter" />
                                        <PagerStyle CssClass="GridPager" />
                                    </asp:GridView>
                                    <hr />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:GridView ID="gvBank_Qin" runat="server" AllowPaging="True" AlternatingRowStyle-CssClass="GridItemAltername"
                                        AutoGenerateColumns="False" CssClass="Grid" DataKeyNames="Id" FooterStyle-CssClass="GridHeaderFooter"
                                        HeaderStyle-CssClass="GridHeaderFooter" PagerStyle-CssClass="GridPager" Width="80%"
                                        OnPageIndexChanging="gvBank_Qin_PageIndexChanging" OnRowCancelingEdit="gvBank_Qin_RowCancelingEdit"
                                        OnRowDataBound="gvBank_Qin_RowDataBound" OnRowDeleting="gvBank_Qin_RowDeleting"
                                        OnRowEditing="gvBank_Qin_RowEditing" OnRowUpdating="gvBank_Qin_RowUpdating">
                                        <AlternatingRowStyle CssClass="GridItemAltername" />
                                        <Columns>
                                            <asp:TemplateField>
                                                <HeaderTemplate>
                                                    م
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <%# Container.DataItemIndex + 1 %>
                                                </ItemTemplate>
                                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="Topic_Name" HeaderText="الدرس" ReadOnly="True" SortExpression="Topic_Name" />
                                            <asp:BoundField DataField="Question_Name" HeaderText="السؤال" ReadOnly="True" SortExpression="Question_Name" />
                                            <asp:TemplateField HeaderText="الدرجة" SortExpression="Degree">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="txtval" runat="server" Text='<%# Bind("Degree") %>'></asp:TextBox>
                                                    <asp:CompareValidator ID="CompareValidator2" runat="server" ControlToValidate="txtval"
                                                        Display="Dynamic" ErrorMessage="ادخل قيمة" ForeColor="Red" Operator="DataTypeCheck"
                                                        Type="Double"></asp:CompareValidator>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Degree") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:CommandField CancelText="إلغاء" EditText="تعديل" ShowEditButton="True" UpdateText="تحــديث" />
                                            <asp:TemplateField ShowHeader="False">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="lkdelete" runat="server" CausesValidation="False" CommandName="Delete"
                                                        Text="حذف"></asp:LinkButton>
                                                </ItemTemplate>
                                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                            </asp:TemplateField>
                                        </Columns>
                                        <FooterStyle CssClass="GridHeaderFooter" />
                                        <HeaderStyle CssClass="GridHeaderFooter" />
                                        <PagerStyle CssClass="GridPager" />
                                    </asp:GridView>
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
    </table>
</asp:Content>
